home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / the_independent.swf / scripts / frame_5 / DoAction_2.as next >
Text File  |  2011-08-19  |  4KB  |  130 lines

  1. function sectionStart(sectionNum)
  2. {
  3.    trace("section: " + sectionNum);
  4.    _global.section = sectionNum;
  5.    switch(sectionNum)
  6.    {
  7.       case 1:
  8.          if(_global.sound)
  9.          {
  10.             bgSound.start(0,1000);
  11.          }
  12.          var b = attachMovie("grey","grey",5);
  13.          b._x = b._y = 0;
  14.          var b = attachMovie("bkgrnd","bkgrnd",20);
  15.          b._x = b._y = 0;
  16.          var b = attachMovie("ground","ground",4000);
  17.          b._x = 0;
  18.          b._y = 800;
  19.          delete b;
  20.          populate();
  21.          var o = attachMovie("openSplash","openSplash",20000);
  22.          slideInPrep(o,"centre");
  23.          delete o;
  24.          break;
  25.       case 2:
  26.          bgSound.stop();
  27.          _global.paperNum = 10;
  28.          _global.peopleScore = 0;
  29.          _global.score = 0;
  30.          _global.peopleHit = 0;
  31.          var i = 0;
  32.          while(i <= 9)
  33.          {
  34.             _root["people" + i].person.gotoandstop(1);
  35.             i++;
  36.          }
  37.          floater.removeMovieClip();
  38.          slideOutPrep(openSplash);
  39.          var b = attachMovie("scoreBar","scoreBar",19000);
  40.          b.paperNum.text = _global.paperNum + "x";
  41.          slideInPrep(b,"top");
  42.          var b = attachMovie("blankMC","searcher",100002);
  43.          b._x = paperBoy._x;
  44.          b._y = paperBoy._y;
  45.          b.onenterframe = search;
  46.          controller.targ = searcher;
  47.          delete b;
  48.          updateScore();
  49.          break;
  50.       case 3:
  51.          var b = attachMovie("arrowGrid","arrowGrid",4600);
  52.          var b = attachMovie("viewingArrows","viewingArrows",7000);
  53.          b._x = 250;
  54.          b._y = 200;
  55.          b._visible = false;
  56.          delete b;
  57.          sectionStart(6);
  58.          break;
  59.       case 4:
  60.          _quality = "LOW";
  61.          scoreBar.paperNum.text = --_global.paperNum + "x";
  62.          paperBoy.play();
  63.          var b = attachMovie("paper","paper",4800);
  64.          b._x = paperBoy._x - 10;
  65.          b._y = paperBoy._y - 25;
  66.          b.relY = paperBoy._y - 25;
  67.          b.rot = arrowGrid.arrow.arrowBit._x + 15.5;
  68.          b.bounce = 0;
  69.          b.tNum = 0;
  70.          b.Xacc = (arrowGrid.arrow.arrowBit._x + 15.5) / 2 * Math.cos(radian * arrowGrid.arrow._rotation);
  71.          b.Yacc = (arrowGrid.arrow.arrowBit._x + 15.5) / 2 * Math.sin(radian * arrowGrid.arrow._rotation);
  72.          delete arrowGrid.onEnterFrame;
  73.          arrowGrid._visible = false;
  74.          paper.onenterframe = movePaper;
  75.          controller.targ = paper;
  76.          delete b;
  77.          break;
  78.       case 5:
  79.          controller.targ = searcher;
  80.          break;
  81.       case 6:
  82.          if(_global.paperNum == 0)
  83.          {
  84.             sectionStart(7);
  85.             break;
  86.          }
  87.          paperBoy.gotoandstop(1);
  88.          _quality = "HIGH";
  89.          _global.potScore = 100;
  90.          _global.lastOb = 99;
  91.          _global.breakout = 0;
  92.          pigeonHit = 99;
  93.          arrowGrid._visible = true;
  94.          arrowGrid.rot = 0;
  95.          arrowGrid.acc = 0;
  96.          arrowGrid._x = paperBoy._x - 10;
  97.          arrowGrid._y = paperBoy._y - 25;
  98.          arrowGrid.onenterframe = moveArrow;
  99.          delete b;
  100.          break;
  101.       case 7:
  102.          slideOutPrep(scoreBar);
  103.          arrowGrid.removeMovieClip();
  104.          viewingArrows.removeMovieClip();
  105.          var f = _root.attachMovie("blankMC","floater",100000);
  106.          f._x = f.relX = 0;
  107.          f._y = f.relY = 120;
  108.          f.xAcc = 5;
  109.          f.yAcc = 0;
  110.          f.onenterframe = float;
  111.          delete f;
  112.          controller.targ = floater;
  113.          var b = attachMovie("totalSplash","totalSplash",20001);
  114.          slideInPrep(b,"centre");
  115.          delete b;
  116.          break;
  117.       case 8:
  118.          slideOutPrep(totalSplash);
  119.          removeBuildings("ForeBuild");
  120.          removeBuildings("backBuild");
  121.          sectionstart(1);
  122.          break;
  123.       case 9:
  124.          slideOutPrep(totalSplash);
  125.          var o = attachMovie("openSplash","openSplash",20000);
  126.          slideInPrep(o,"centre");
  127.          delete o;
  128.    }
  129. }
  130.